<template>
  <div class="mytab">
    <el-row>
      <el-col>
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          background-color="#545c68"
          text-color="#fff"
          active-text-color="#20a0ff"
          router
        >
          <el-menu-item @click="$router.push('/home/index')">
            <i class="el-icon-setting"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>数据管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item @click="$router.push('/home/userlist')"
                >用户列表</el-menu-item
              >
              <el-menu-item @click="$router.push('/home/shoplist')"
                >商家列表</el-menu-item
              >
              <el-menu-item @click="$router.push('/home/foodlist')"
                >食品列表</el-menu-item
              >
              <el-menu-item @click="$router.push('/home/oriderlist')"
                >订单列表</el-menu-item
              >
              <el-menu-item @click="$router.push('/home/adminlist')"
                >管理员列表</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>添加数据</span>
            </template>
            <el-menu-item-group>
              <el-menu-item @click="$router.push('/home/addShop')"
                >添加商铺</el-menu-item
              >
              <el-menu-item @click="$router.push('/home/addprice')"
                >添加商品</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>图表</span>
            </template>
            <el-menu-item-group>
              <el-menu-item @click="$router.push('/home/visitor')"
                >用户分布</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="5">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>编辑</span>
            </template>
            <el-menu-item-group>
              <el-menu-item @click="$router.push('/home/edit')"
                >文本编辑</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="6">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>设置</span>
            </template>
            <el-menu-item-group>
              <el-menu-item @click="$router.push('/home/adminset')"
                >管理员设置</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="7">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>说明</span>
            </template>
            <el-menu-item-group>
              <el-menu-item @click="$router.push('/home/explain')"
                >说明</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { Row, Col, Menu, MenuItem, MenuItemGroup, Submenu } from "element-ui";
export default {
  components: {
    [Row.name]: Row,
    [Col.name]: Col,
    [Menu.name]: Menu,
    [Submenu.name]: Submenu,
    [MenuItem.name]: MenuItem,
    [MenuItemGroup.name]: MenuItemGroup,
  },
};
</script>

<style lang="scss" scoped>
.el-menu-item {
  background-color: #262829;
}
</style>
